package com.oo.app.ui.main.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.oo.app.R;
import com.oo.app.base.activities.BaseActivity;
import com.oo.app.ui.dialog.PutForwardExamineDialog;
import com.oo.app.widget.toast.Prompt;
import com.oo.app.widget.toast.SnackbarToast;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by 赵聪 on 2018/7/28.
 * 收益提现
 */

public class EarningsPutForwardActivity extends BaseActivity implements View.OnClickListener{
    @BindView(R.id.tv_title)
    TextView tv_title;

    @BindView(R.id.et_amount_of_money)
    EditText et_amount_of_money;

    @BindView(R.id.tv_may_put_forward_money)
    TextView tv_may_put_forward_money;  //可提现金额

    @BindView(R.id.et_account_alipay)
    EditText et_account_alipay;

    @Override
    protected int getContentView() {
        return R.layout.lay_earnings_put_forward;
    }

    @Override
    protected void initWidget() {
        super.initWidget();
        tv_title.setText("收益提现");
    }

    @Override
    protected void initData() {
        super.initData();
    }

    public static void show(Context context) {
        Intent intent = new Intent(context, EarningsPutForwardActivity.class);
        context.startActivity(intent);
    }

    @OnClick({R.id.iv_back, R.id.btn_put_forward, R.id.tv_put_forward_illustrate, R.id.iv_account_alipay})
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.btn_put_forward: //我要提现

                SnackbarToast.make(this, "提现金额需大于50元!", 3000l).setPromptThemBackground(Prompt.ERROR).show();

                pfedialog();
                break;
            case R.id.tv_put_forward_illustrate: //提现说明
                PutForwardIllustrateActivity.show(EarningsPutForwardActivity.this);
                break;
            case R.id.iv_account_alipay: //绑定手机号
                BindingPhoneActivity.show(EarningsPutForwardActivity.this);
                break;
        }
    }

    public void pfedialog(){
        final PutForwardExamineDialog pfeDialog = new PutForwardExamineDialog(EarningsPutForwardActivity.this);
        pfeDialog.show();
        pfeDialog.setClicklistener(new PutForwardExamineDialog.ClickListenerInterface() {
            @Override
            public void doConfirm() {
                pfeDialog.dismiss();
            }

            @Override
            public void doCancel() {
                pfeDialog.dismiss();
            }
        });
    }
}
